status: Add more tests for json
authorColin Walters <walters@verbum.org>
Fri, 27 Jun 2025 01:02:03 +0000 (21:02 -0400)
committerColin Walters <walters@verbum.org>
Fri, 27 Jun 2025 12:08:59 +0000 (08:08 -0400)
Signed-off-by: Colin Walters <walters@verbum.org>
tests/kolainst/destructive/staged-deploy.sh

index a268a5ccfba7dea4b07b0912ae367b45cf33d1e1..e2fe1b54f87484562374e39fab9810fa586c51e2 100755 (executable)
@@ -35,6 +35,10 @@ EOF
     ## TODO remove workaround for https://github.com/coreos/rpm-ostree/pull/2021
     mkdir -p /var/lib/rpm-ostree/history
     rpm-ostree cleanup -pr
+
+    ostree admin status --json > status.json
+    jq -e '.deployments[0].staged | not' status.json
+
     commit=${host_commit}
   # Test the deploy --stage functionality; first, we stage a deployment
   # reboot, and validate that it worked.
@@ -49,7 +53,13 @@ EOF
     newcommit=$(ostree rev-parse staged-deploy)
     orig_mtime=$(stat -c '%.Y' /sysroot/ostree/deploy)
     systemctl show -p ActiveState ostree-finalize-staged.service | grep -q inactive
+
+    # Do the staged deployment
     ostree admin deploy --stage staged-deploy
+
+    # Verify state
+    ostree admin status --json > status.json
+    jq -e '.deployments[0].staged' status.json
     systemctl show -p ActiveState ostree-finalize-staged.service | grep active
     new_mtime=$(stat -c '%.Y' /sysroot/ostree/deploy)
     test "${orig_mtime}" != "${new_mtime}"